﻿@{
    ViewData["Title"] = "路径明细详情";
    ViewData["Mbx"] = "配置管理";
    Layout = "_Default";
}

@section css{
    <style>
        
        .fliter {
            width: 80%;
            height: 60px;
            align-items: center;
            display: flex;
            margin-bottom: 20px;
        }
        .fliter .search-btn {
            margin-left: 20px;
        }
        .fliter .input-text{
            width: 200px;
        }
        .fliter .label-eq-name{
            margin-left: 20px;
        }
        .fliter .input-text-eq-code{
            width: 200px;
            height: 23px;
        }
    </style>
}

<div class="fliter">
    <label class="label-eq-code">路径ID：</label>
    <input type="text" class="input-text" value="@Model.ID" placeholder="" readonly="readonly" id="routeId" name="routeId">
    <label class="label-eq-name">起始工位：</label>
    <input type="text" class="input-text" value="@Model.FromStation" placeholder="" readonly="readonly" id="FromStation" name="FromStation">
    <label class="label-eq-name">目标工位：</label>
    <input type="text" class="input-text" value="@Model.ToStation" placeholder="" readonly="readonly" id="ToStation" name="ToStation">
</div>

<table class="table table-border table-bordered table-hover table-bg table-sort">
    <thead>
    </thead>
    <tbody>
    </tbody>
</table>

@section javascript{
<script>
    $(function(){
        var routeId = $("#routeId").val();
        initData(routeId);
    });


    function initData(routeId){
        $('.table-sort').dataTable({
            bProcessing: true, //DataTables 载入数据时，是否显示‘进度’提示
            bAutoWidth: false, //自动宽度
            bSort: false, //排序功能
            paging : false, //是否分页
            bInfo: false, //页脚信息,默认为 true
            bStateSave: false, //状态保存
            sPaginationType: "full_numbers", //分页显示样式
            serverSide: false, //启用服务器分页
            //sAjaxSource: "/admin/functionlist", //服务端请求数据接口
            searching: false, //关闭 datatables 的搜索框
            destroy: true, //解决重新渲染问题
            iDisplayLength: 100, //每页显示数量
            ajax:{
                    url: "/routeinfo/getroutedetailinfobyrouteid",
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded",
                    async: false,
                    dataType: "json",
                    data: function(data){
                        data.routeId = routeId;
                    },
                    dataFilter: function(json){
                        console.log(json);
                        return json;
                    }
               },

            aoColumns:[
                // mDataProp：绑定数据属性
                // sDefaultContent：设置默认值
                // sClass：添加 class 属性，不懂的直接去掉
                // sTtile：设置列标题
                // sWidth：设置列宽度
                // sTtile 设置的内容，会替换到 html thead 中的“标题”
                //{mDataProp:"js_Id", sClass:"text-c",  sTitle:"编号",sDefaultContent:""},
                {mDataProp:"js_Id", sClass:"text-c", sTitle:"ID",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"js_PrevionsID", sClass:"text-c", sTitle:"前一节点ID",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"dispatchTypeDescription",  sClass:"text-c", sTitle:"调度类型",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"isStart",  sClass:"text-c", sTitle:"是否起始节点",sDefaultContent:"",sWidth:"5%",
                mRender: function(data, type, row){
                        var html = "<span class=\"label label-success\">是</span>";
                        if(!data){
                            html = "<span class=\"label label-danger\">否</span>";
                        }
                        return html;
                    }
                },
                {mDataProp:"isEnd",  sClass:"text-c", sTitle:"是否结束节点",sDefaultContent:"",sWidth:"5%",
                mRender: function(data, type, row){
                        var html = "<span class=\"label label-success\">是</span>";
                        if(!data){
                            html = "<span class=\"label label-danger\">否</span>";
                        }
                        return html;
                    }
                },
                {mDataProp:"fromEquipment",  sClass:"text-c", sTitle:"起始设备",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"fromCargo",  sClass:"text-c", sTitle:"起始货位",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"fromCargoColumn",  sClass:"text-c", sTitle:"起始货位列",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"toEquipment",  sClass:"text-c", sTitle:"目标设备",sDefaultContent:"",sWidth:"10%"},
                {mDataProp:"toCargo",  sClass:"text-c", sTitle:"目标货位",sDefaultContent:"",sWidth:"10%"},
                
            ],
            oLanguage: { //国际化配置
                sProcessing : "正在获取数据，请稍后...",
                sLengthMenu : "显示 _MENU_ 条",
                sZeroRecords : "没有您要搜索的内容",
                sInfo : "从 _START_ 到  _END_ 条记录 总记录数为 _TOTAL_ 条",
                sInfoEmpty : "记录数为0",
                sInfoFiltered : "(全部记录数 _MAX_ 条)",
                sInfoPostFix : "",
                sSearch : "从当前数据中检索： ",
                sUrl : "",
                oPaginate: {
                    sFirst : "首页",
                    sPrevious : "上一页",
                    sNext : "下一页",
                    sLast : "尾页"
                }
            }
        });
    }
    
</script>
}

